import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { BusiProvider } from '../../providers/busi/busi';

/**
 * Generated class for the MybookedPage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */

@IonicPage()
@Component({
  selector: 'page-mybooked',
  templateUrl: 'mybooked.html',
})
export class MybookedPage {
  myboookedClassRoomList = [];
  objectKeys = Object.keys;
  constructor(public navCtrl: NavController, public navParams: NavParams, public busi:BusiProvider) {
  }

  ionViewDidLoad() {
    console.log('ionViewDidLoad MybookedPage');
  }
  ionViewDidEnter(){
    this.busi.getMyBookedClassRoom().subscribe(
      data=>{
        this.myboookedClassRoomList = data.mybookedclassroom;
      },
      error=>{

      }
    );
  }

  showClassRoomDetail(key,detail){
    this.navCtrl.push("ClassroomdetailPage",{classroom:key,detail:detail})
  }

}
